import { createStore } from 'vuex'

export default createStore({
  state: {
    token:localStorage.getItem('token') || '',
    username:localStorage.getItem('username') || ''
  },
  mutations: {
    set_token(state,value){
      state.token=value
      localStorage.setItem('token',value)
    },
    set_username(state,value){
      state.username=value
      localStorage.setItem('username',value)
    }
  },
  actions: {
  },
  modules: {
  }
})
